package com.heatup.apt.api.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.heatup.apt.api.service.UserLostLogService;
import com.heatup.apt.model.user.UserLostLog;

/**
 *
 * UserLostLog 控制层
 *
 */
@Controller
@RequestMapping("/user_log")
public class UserLostLogController extends BaseController{

	@Resource
	private UserLostLogService UserLostLogService;
	@ResponseBody
	@RequestMapping(value = "log", method={RequestMethod.POST, RequestMethod.GET})
	public String updateCashcardCode(UserLostLog userLostLog){
		if(!this.isLogined()) {
			return null;
		}
		userLostLog.setUserId(this.getUserId());
		userLostLog.setOpenId(this.getUserInfo().getOpenid());
		int res = UserLostLogService.selectCount(userLostLog);
		if(res <= 0) {
			this.UserLostLogService.insertOrUpdate(userLostLog);
		}
		return null;
	}

}